Zero1000

typescript

01: id & passwd
1: css



1. node確認



% node --version
v16.2.0	

2. 作業フォルダー作成

	


% mkdir typescript

% cd typescript

typescript%
  

3. npm init

	  
% npm init 
	

4. typescriptをインストール

	  
 % npx tsc --init
	

5. .tsファイルを作成

% cat test.ts
let a = 10
let b = 20
let c: number
c = a + b
console.log(c)

6. トランスコンパイル

	  
 % npx tsc test.ts
	

6. jsファイルを実行

	  
 % node test.js
30